﻿using System;
using System.Collections.ObjectModel;

using Sunyi.Project.WebPoint.DataAccessController;
using Sunyi.Project.WebPoint.DataContract;

namespace Sunyi.Project.WebPoint.BusinessLogic
{
    public static class Logger
    {
        static LogDaoController controller = new LogDaoController();

        public static Log Select(Guid id)
        {
            return controller.Select(id);
        }

        public static void Write(Log log)
        {
            controller.Insert(log);
        }

        public static int SearchCount(string level, string source, string category, string eventId, DateTime insertTimestamp)
        {
            return controller.SearchCount(level, source, category, eventId, insertTimestamp);
        }

        public static Collection<Log> Search(string level, string source, string category, string eventId, DateTime insertTimestamp, int pageIndex, int pageSize)
        {
            return controller.Search(level, source, category, eventId, insertTimestamp, pageIndex, pageSize);
        }

        public static void DeleteAll()
        {
            controller.DeleteAll();
        }
    }
}
